package com.guanyong.admin.controllers.page;


import com.guanyong.model.PriceTagModel;
import com.guanyong.model.UserInfoModel;
import com.guanyong.services.PriceTagService;
import com.guanyong.services.UserInfoService;
import com.guanyong.utils.Cache.ICahce.ICache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/page/price")
public class PriceTagPage  extends baseController {


    @Autowired
    PriceTagService priceTagService;



    @RequestMapping({"/pricetaglist"})
    String pricetaglist(HttpServletRequest request) {
        return "/account/pricetaglist";
    }


    @RequestMapping({"/pricetagadd"})
    String pricetagadd(HttpServletRequest request) {
        return "/account/pricetagadd";
    }

    @RequestMapping({"/pricetagupdate"})
    String pricetagupdate(Model model,HttpServletRequest request) {
        String fid=request.getParameter("fid");
        PriceTagModel priceTagModel =priceTagService.GetPriceTagById(fid);
        if (priceTagModel!=null){
            model.addAttribute("pricetag",priceTagModel);
            return "/account/pricetagupdate";
        }
        else{
            return "errorPage/500";
        }

    }
}
